<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>loginLog管理</title>
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <!-- 引入样式 -->
    <link rel="stylesheet" href="https://unpkg.com/element-ui/lib/theme-chalk/index.css">
    <link rel="stylesheet" href="../plugins/font-awesome/css/font-awesome.min.css">
    <link rel="stylesheet" href="../css/style.css">

    <!-- 上传图片框样式，不使用上传组件可以删除此样式 -->
    <style>
        .avatar-uploader .el-upload {
            border: 1px dashed #d9d9d9;
            border-radius: 6px;
            cursor: pointer;
            position: relative;
            overflow: hidden;
        }
        .avatar-uploader .el-upload:hover {
            border-color: #409EFF;
        }
        .avatar-uploader-icon {
            font-size: 28px;
            color: #8c939d;
            width: 150px;
            height: 70px;
            line-height: 150px;
            text-align: center;
        }
        .avatar {
            width: 150px;
            height: 70px;
            display: block;
        }

    </style>
</head>
<body class="hold-transition">
<div id="app">

    <div class="content-header">
        <h1>管理<small>登录日志</small></h1>
        <el-breadcrumb separator-class="el-icon-arrow-right" class="breadcrumb">
            <el-breadcrumb-item :to="{ path: '/' }">首页</el-breadcrumb-item>
            <el-breadcrumb-item>管理</el-breadcrumb-item>
            <el-breadcrumb-item>loginLog管理</el-breadcrumb-item>
        </el-breadcrumb>
    </div>

    <div class="app-container">
        <div class="box">
            <div class="filter-container">

            </div>

            <el-table :data="tableData" border style="width: 100%">
                          <el-table-column prop="id" label="id" width="80"></el-table-column>
          <el-table-column prop="loginName" label="login_name" width="80"></el-table-column>
          <el-table-column prop="ip" label="ip" width="80"></el-table-column>
          <el-table-column prop="browserName" label="browser_name" width="80"></el-table-column>
          <el-table-column prop="location" label="地区" width="80"></el-table-column>
          <el-table-column prop="loginTime" label="登录时间" width="80"></el-table-column>


            </el-table>
            <div class="pagination-container">
                <el-pagination
                        class="pagiantion"
                        @size-change="fetchData"
                        @current-change="fetchData"
                        :current-page.sync="currentPage"
                        :page-sizes="[10, 20, 30, 40]"
                        :page-size="size"
                        layout="total, sizes, prev, pager, next, jumper"
                        :total="total">
                </el-pagination>
            </div>
            <div class="add-form">

            </div>

        </div>
    </div>


</div>
</body>
<script src="/js/vue.js"></script>
<script src="/js/axios.js"></script>
<script src="/js/elementui.js"></script>
<script>
     new Vue({
        el: '#app',
        data(){
            return {
                tableData: [],
                currentPage: 1,
                total: 10,
                size: 10
            }
        },
        created(){
            this.fetchData();
        },
        methods:{
            fetchData (){
                axios.get(`/loginLog/findPageByLogin.do?page=${this.currentPage}&size=${this.size}`).then(response => {
                    this.tableData = response.data.rows;
                    this.total = response.data.total;
                });
            }
        }
    })
</script>
</html>
